@ECHO OFF

IF "%1" == "" goto :BAD_ARGS
IF "%2" == "" goto :BAD_ARGS
IF "%3" == "" goto :BAD_ARGS
IF NOT EXIST "%1" goto :BAD_ARGS

set _ARMVER_=
set COMPILER_TOOL_VERSION_NUM=%3
set COMPILER_TOOL_VERSION=%2%3
set COMPILER_TOOL=%2

set _ARMVER_=_v%COMPILER_TOOL_VERSION_NUM:.=_%

SET ADS_TOOLS=%1\tools\ads%_ARMVER_%
SET ADS_TOOLS_BIN=%ADS_TOOLS%\BIN
SET ARMROOT=%ADS_TOOLS%
SET ARMCONF=%ADS_TOOLS%\BIN
SET ARMDLL=%ADS_TOOLS%\BIN
SET ARMHOME=%ADS_TOOLS%
SET ARMINC=%ADS_TOOLS%\INCLUDE
SET ARMLIB=%ADS_TOOLS%\LIB
SET ARMLMD_LICENSE_FILE=%ADS_TOOLS%\licenses\license.dat
set ARMBIN=%ADS_TOOLS%\BIN

SET RVCT30BIN=%ARMROOT%\BIN
SET RVCT30INC=%ARMROOT%\INCLUDE
SET RVCT30LIB=%ARMROOT%\LIB
SET RVCT31BIN=%ARMROOT%\BIN
SET RVCT31INC=%ARMROOT%\INCLUDE
SET RVCT31LIB=%ARMROOT%\LIB
set RVCT41BIN=%ARMROOT%\BIN
set RVCT41INC=%ARMROOT%\INCLUDE
set RVCT41LIB=%ARMROOT%\LIB


set DOTNETMF_COMPILER=%COMPILER_TOOL_VERSION%

SET PATH=%PATH%;%ARMDLL%;

SET PATH=%PATH%;%1\..\tools\x86\perl\bin;

SET OEM_NAME=Sample_Microsoft

goto :EOF

:BAD_ARGS
@ECHO.
@ECHO Invalid arguments!  Usage: SetArmVars.cmd SPOCLIENT COMPILER_TOOL COMPILER_TOOL_VERSION
@ECHO     Where SPOCLIENT is the //depot/current/client_vx_x path
@ECHO     Where COMPILER_TOOL         is RVDS, ADI, ...
@ECHO     Where COMPILER_TOOL_VERSION is 3.0, 3.1, 4.0, 4.1, 4.2, ...
@ECHO.
